package com.ckm.provider;

import com.ckm.creator.DefaultMongoSourceCreator;
import org.springframework.boot.autoconfigure.mongo.MongoProperties;
import org.springframework.data.mongodb.MongoDatabaseFactory;

import java.util.Map;


public class YmlDynamicMongoSourceProvider extends AbstractMongoSourceProvider{

    private final Map<String, MongoProperties> propertiesMap;

    public YmlDynamicMongoSourceProvider(DefaultMongoSourceCreator defaultMongoSourceCreator, Map<String, MongoProperties> propertiesMap) {
        super(defaultMongoSourceCreator);
        this.propertiesMap = propertiesMap;
    }

    @Override
    public Map<String, MongoDatabaseFactory> loadMongoSource() {
        return createMongoSourceMap(propertiesMap);
    }
}
